package com.ruoyi.finance.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.finance.mapper.TSalaryBillInfoMapper;
import com.ruoyi.finance.domain.TSalaryBillInfo;
import com.ruoyi.finance.service.ITSalaryBillInfoService;

/**
 * 工资账单Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-05-14
 */
@Service
public class TSalaryBillInfoServiceImpl implements ITSalaryBillInfoService 
{
    @Autowired
    private TSalaryBillInfoMapper tSalaryBillInfoMapper;

    /**
     * 查询工资账单
     * 
     * @param salaryBillId 工资账单主键
     * @return 工资账单
     */
    @Override
    public TSalaryBillInfo selectTSalaryBillInfoBySalaryBillId(Long salaryBillId)
    {
        return tSalaryBillInfoMapper.selectTSalaryBillInfoBySalaryBillId(salaryBillId);
    }

    /**
     * 查询工资账单列表
     * 
     * @param tSalaryBillInfo 工资账单
     * @return 工资账单
     */
    @Override
    public List<TSalaryBillInfo> selectTSalaryBillInfoList(TSalaryBillInfo tSalaryBillInfo)
    {
        return tSalaryBillInfoMapper.selectTSalaryBillInfoList(tSalaryBillInfo);
    }

    /**
     * 新增工资账单
     * 
     * @param tSalaryBillInfo 工资账单
     * @return 结果
     */
    @Override
    public int insertTSalaryBillInfo(TSalaryBillInfo tSalaryBillInfo)
    {
        tSalaryBillInfo.setCreateTime(DateUtils.getNowDate());
        return tSalaryBillInfoMapper.insertTSalaryBillInfo(tSalaryBillInfo);
    }

    /**
     * 修改工资账单
     * 
     * @param tSalaryBillInfo 工资账单
     * @return 结果
     */
    @Override
    public int updateTSalaryBillInfo(TSalaryBillInfo tSalaryBillInfo)
    {
        tSalaryBillInfo.setUpdateTime(DateUtils.getNowDate());
        return tSalaryBillInfoMapper.updateTSalaryBillInfo(tSalaryBillInfo);
    }

    /**
     * 批量删除工资账单
     * 
     * @param salaryBillIds 需要删除的工资账单主键
     * @return 结果
     */
    @Override
    public int deleteTSalaryBillInfoBySalaryBillIds(Long[] salaryBillIds)
    {
        return tSalaryBillInfoMapper.deleteTSalaryBillInfoBySalaryBillIds(salaryBillIds);
    }

    /**
     * 删除工资账单信息
     * 
     * @param salaryBillId 工资账单主键
     * @return 结果
     */
    @Override
    public int deleteTSalaryBillInfoBySalaryBillId(Long salaryBillId)
    {
        return tSalaryBillInfoMapper.deleteTSalaryBillInfoBySalaryBillId(salaryBillId);
    }

    /**
     * 查询工资账单ID
     *
     * @param salaryBillNumber 工资单号
     * @return 结果
     */
    @Override
    public Long selectSalaryBillIdBySalaryBillNumber(String salaryBillNumber)
    {
        return tSalaryBillInfoMapper.selectSalaryBillIdBySalaryBillNumber(salaryBillNumber);
    }
}
